package ups.glre.news.webservice.util;

import ups.glre.news.model.News;
import ups.glre.news.webservice.dto.NewsDTO;

public final class Util {

	public static NewsDTO toDTO (News news) {
		NewsDTO newsDTO = new NewsDTO();
		newsDTO.setAuthor(news.getAuthor().getLogin());
		newsDTO.setCategory(news.getCategory().getCategoryName());
		newsDTO.setContent(news.getContent());
		newsDTO.setTitle(news.getTitle());
		return newsDTO;
	}
}
